package com.library.common.utils.z3950;

import java.util.HashMap;
import java.util.Map;

/**
 * @Package: com.library.common.utils.z3950
 * @ClassName: LangueUtils
 * @Author: Yin
 * @Date: 17:52
 * @Description: 机读目录记录数据 语种对照
 */
public class LanguageUtils {

    /**
     * 语种记录表
     */
    private static final Map<String,String> tables = new HashMap<>();

    static {
        tables.put("chi","汉语");
        tables.put("alb","阿尔巴尼亚语");
        tables.put("ara","阿拉布语");
        tables.put("ben","孟加拉语");
        tables.put("bul","保加利亚语");
        tables.put("bur","缅甸语");
        tables.put("cam","高棉语");
        tables.put("cze","捷克语");
        tables.put("dan","丹麦语");
        tables.put("ice","冰岛语");
        tables.put("inc","印度语");
        tables.put("ind","印尼语");
        tables.put("ita","意大利语");
        tables.put("jpn","日语");
        tables.put("kaz","哈萨克语");
        tables.put("kir","吉尔吉斯语");
        tables.put("kon","刚果语");
        tables.put("kor","朝鲜语");
        tables.put("pol","波斯语(近代)");
        tables.put("por","波兰语");
        tables.put("rum","罗马尼亚语");
        tables.put("rus","俄语");
        tables.put("san","梵语");
        tables.put("slo","斯洛伐克语");
        tables.put("spa","西班牙语");
        tables.put("swe","瑞典语");
        tables.put("dut","衫加飼");
        tables.put("egy","埃及语");
        tables.put("eng","英语");
        tables.put("esp","世界语");
        tables.put("fre","法语");
        tables.put("ger","德语");
        tables.put("gre","西腊语(近代)");
        tables.put("heb","希伯来语");
        tables.put("hun","匈牙利语");
        tables.put("lao","寮国语");
        tables.put("lat","拉丁语");
        tables.put("may","马来语");
        tables.put("mlt","马尔他语");
        tables.put("mon","蒙古语");
        tables.put("mul","多种语言");
        tables.put("nep","尼泊尔语");
        tables.put("nor","挪威语");
        tables.put("syr","叙利亚语");
        tables.put("tha","泰语");
        tables.put("tib","藏语");
        tables.put("tur","土耳其语");
        tables.put("uig","维吾尔语");
        tables.put("vie","越南语");
        tables.put("yao","瑶族语");
        tables.put("yid","犹太语");
    }

    /**
     * 返回中文
     * @param str 字符 chi -> 汉语
     * @return 中文翻译
     */
    public static String toCn(String str) {
        if(tables.containsKey(str)) {
            return tables.get(str);
        }
        return "";
    }

}
